import request from '@/utils/request'
/*
  params 会自动进行url拼接，其它类似name、search这些则不会自动拼接
*/

export function listMobile(params) {
  return request({
    url: '/mobile/',
    method: 'get',
    params
  })
}

export function TreeMobileWechat() {
  return request({
    url: '/mobile_wechat_tree/',
    method: 'get'
  })
}

export function checkMobileName(params) {
  return request({
    url: '/check/mobile/name/',
    method: 'get',
    params
  })
}

export function addMobile(data) {
  return request({
    url: '/mobile/',
    method: 'post',
    data
  })
}

export function editMobile(id, data) {
  return request({
    url: '/mobile/' + id + '/',
    method: 'put',
    data
  })
}

export function viewMobile(id) {
  return request({
    url: '/mobile/' + id + '/',
    method: 'get'
  })
}

export function delMobile(id) {
  return request({
    url: '/mobile/' + id,
    method: 'delete'
  })
}

export function statusMobile(data) {
  return request({
    url: '/mobile/status_bool/',
    method: 'post',
    data
  })
}

export function exportMobileAll() {
  return request({
    url: '/mobile/export_all/',
    method: 'post'
  })
}

export function exportMobileCurrent(params) {
  return request({
    url: '/mobile/export_current/',
    method: 'post',
    params
  })
}

export function DownloadTemplateFileMobile() {
  return request({
    url: '/mobile/download_template_file/',
    method: 'get'
  })
}

export function UploadDataFileMobile(data) {
  return request({
    url: '/mobile/import_file/',
    method: 'post',
    data
  })
}
